package com.cssy.xxkj.logic.service.impl;

import java.util.Date;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.byd.acegiext.domain.User;
import com.cssy.xxkj.logic.dao.LogicWarehousePriceDetailsDAO;
import com.cssy.xxkj.logic.entity.LogicWarehousePriceDetailsDO;
import com.cssy.xxkj.logic.service.ILogicWarehousePriceDetailsService;
import com.plat.exception.SyBaseException;
import com.plat.helper.SearchConditions;
import com.plat.helper.SearchResult;
import com.plat.util.IDCodeTypeUtil;

@Service("logicWarehousePriceDetailsService")
public class LogicWarehousePriceDetailsServiceImpl implements ILogicWarehousePriceDetailsService {

	@Resource(name="logicWarehousePriceDetailsDAO")
	private LogicWarehousePriceDetailsDAO logicWarehousePriceDetailsDAO;
	
	@Override
	public SearchResult findListByExample(SearchConditions scs)
			throws SyBaseException {
		SearchResult rs=new SearchResult(scs);
		List<LogicWarehousePriceDetailsDO>  list=logicWarehousePriceDetailsDAO.find(scs);
		rs.setRecordCount(logicWarehousePriceDetailsDAO.count(scs));
		rs.setResults(list);
		return rs;
	}

	@Override
	public Integer delete(String id, User user) throws SyBaseException {
		return logicWarehousePriceDetailsDAO.deleteLogicWarehousePriceDetailsDOByPrimaryKey(id);
	}

	@Override
	public Integer update(LogicWarehousePriceDetailsDO t, User user)
			throws SyBaseException {
		t.setBizModifyName(user.getName());
		t.setBizModifyDate(new Date());
		return logicWarehousePriceDetailsDAO.updateLogicWarehousePriceDetailsDO(t);
	}

	@Override
	public LogicWarehousePriceDetailsDO save(LogicWarehousePriceDetailsDO t, User user)
			throws SyBaseException {
		t.setBizCreatorName(user.getName());
		t.setBizCreatorDate(new Date());
		t.setId(IDCodeTypeUtil.getId());
		logicWarehousePriceDetailsDAO.insertLogicWarehousePriceDetailsDO(t);
		return t;
	}

	@Override
	public LogicWarehousePriceDetailsDO findListById(String id) throws SyBaseException {
		return logicWarehousePriceDetailsDAO.findLogicWarehousePriceDetailsDOByPrimaryKey(id);
	}

	@Override
	public List<LogicWarehousePriceDetailsDO> findListByExample(
			LogicWarehousePriceDetailsDO lDetailsDO) throws SyBaseException {
		return logicWarehousePriceDetailsDAO.findListByExample(lDetailsDO);
	}

	@Override
	public Integer deleteBizRemoved(String id) throws SyBaseException {
		// TODO Auto-generated method stub
		return null;
	}

}
